Overview: Shift Values

Use this operation to create an offset and shift the data values in a specific field. An offset will shift the values of the selected field up or down the row position. In the rows where an offset was created, the value of the previous data positions will be null. An offset of +10 will shift the values down 10 rows. The first 10 rows of the new field will have a null value. This will in effect remove the last 10 rows of the dataset. An offset of -10 will shift your values up ten rows.  The last ten rows of this field will have null values. The first ten rows of your dataset will thus be removed. You can only offset one field at a time, but you can add multiple offsets for that field, resulting in more than one offset field being added to the dataset. This operation modifies the existing dataset by adding the offset field to the existing fields.

Properties

Category:

Add

Performance risk:

Low performance risk

Knowledge required:

None

 

Effect on datasets

How many datasets are required to perform this operation?

One

Does it create a new dataset?

No

Can you reconfigure this operation?

Yes

Can you apply this operation to a locked dataset?

No

Does it modify the current dataset in any way?

Yes

Requirements

  • This operation needs a dataset with at least one field of any type.

Results

  • For each offset defined, a new field will be created with the data moved up or down by the offset amount, defined in number of rows.

  • When the data is moved by the offset amount, the rows that originally contained values will be filled with null values.

  • One or more columns will be added to the existing dataset depending on how many offset fields you created. The added fields will have the same data values as the selected field, except these values will be offset to a different row position.

  • When you create an offset field with an offset value that is more than the total row count (negative or positive) the whole column will have null values. Only create offsets of less than the row count.


Related topics:

  

CSense 2023- Last updated: November 17,2023